// import requestMethods from '@/util/requestMethods'  //封装的GET POST等方法
// import{LOGIN,
//       GETUSERADDRESS,
//       DELETEADDRESS,
//       PUTADDRESS,
//       POSTADDRESS,
//       } from '@/services/api' //资源请求的地址
// import{GETUSERINFO,
//     PUTUSERINFO,
//     POSTUSERINFO,
//     GETALLUSER} from '@/services/api'

// const header={};
// // 此模块用于处理所有有关用户信息
// export async function login(params){                        //由MyIndex里的loginrofm,再去util的requestMe获方法
//     return requestMethods.post(LOGIN,params,header)
// }

// export async function getUserAddress(params){
//     return requestMethods.get(GETUSERADDRESS,params,header);
// }

// export async function deleteAddress(params){
//     return requestMethods.delete(DELETEADDRESS,params,header);
// }

// export async function addAddress(params){
//     return requestMethods.post(POSTADDRESS,params,header);
// }
// export async function editAddress(params){
//     return requestMethods.put(PUTADDRESS,params,header);
// }

// export async function getUserInfo(params){
//     return requestMethods.get(GETUSERINFO,params,header);
// }

// export async function addUser(params){
//     return requestMethods.post(POSTUSERINFO,params,header);
// }

// export async function editUser(params){
//     return requestMethods.put(PUTUSERINFO,params,header);
// }
// export async function getAllUser(params){
//     return requestMethods.get(GETALLUSER,params,header);
// }

import instance from '@/util/requestMethods'
import {
    LOGIN,
    GETUSERINFOBYID,
    USERMANAGE,
    SAVEUSER,
    SEARCHUSER,
    ADDUSER,
    DELETEUSER,
    EDITUSER,
    UPDATEUSER,
    GETONEUSERBYID,
    REGISTERUSER,
    UPDATEUSERPASSWORD
} from '@/services/api'

import { REGISTER } from './api'

const header={}
//此模块用于处理所有有关用户信息的
export async function login(params){
    // return http.get(`${GETNEWSBYTYPENUM}/${params.newsTypeId}/${params.newNum}`,null,header)
    return instance.post(LOGIN,params,header)
}

export async function getUserInfoById(params){
    return instance.get(GETUSERINFOBYID,params,header)
}

export async function userManage(params){
    return instance.get(USERMANAGE,params,header)
}

export async function saveUser(params){
    return instance.post(SAVEUSER,params,header)
}

export async function deleteUser(params){
    return instance.post(DELETEUSER,params,header)
}

export async function searchUser(params){
    return instance.get(SEARCHUSER,params,header)
}

export async function updateUser(params){
    return instance.post(UPDATEUSER,params,header)
}

export async function editUser(params){
    return instance.post(EDITUSER,params,header)
}

export async function addUser(params){
    return instance.get(ADDUSER,params,header)
}

export async function getOneUserById(params){
    return instance.get(GETONEUSERBYID,params,header)
}

export async function registerUser(params){
    return instance.post(REGISTERUSER,params,header)
}

export async function updateUserPassword(params){
    return instance.post(UPDATEUSERPASSWORD,params,header)
}
